package cn.elwy.rcp.demo;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class DialogMain {

  /**
   * Launch the application.
   * @param args
   */
  public static void main(String[] args) {
    Display display = Display.getDefault();
    Shell shell = new Shell();
    shell.setSize(450, 300);
    shell.setText("SWT Application");
    shell.setLayout(new FillLayout(SWT.HORIZONTAL));

    Composite composite = new Composite(shell, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));

    NatTable natTable = new NatTable(composite);
    natTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    shell.open();
    shell.layout();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
  }
}
